<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="StringUtil,mx.utils.StringUtil,isWhitespace,substitute,trim,trimArrayElements" name="keywords">
<title>mx.utils.StringUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'StringUtil - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/utils/StringUtil.html&amp;mx/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;StringUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class StringUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class StringUtil</td>
</tr>
</table>
<p></p>
  The StringUtil utility class is an all-static class with methods for
  working with String objects within Flex.
  You do not create instances of StringUtil;
  instead you call methods such as 
  the <code>StringUtil.substitute()</code> method.  
 <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isWhitespace()">isWhitespace</a>(character:String):Boolean</div>
<div class="summaryTableDescription">[static]
      Returns <code>true</code> if the specified string is
      a single space, tab, carriage return, newline, or formfeed character.</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#substitute()">substitute</a>(str:String, ... rest):String</div>
<div class="summaryTableDescription">[static]
      Substitutes "{n}" tokens within the specified string
      with the respective arguments passed in.</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#trim()">trim</a>(str:String):String</div>
<div class="summaryTableDescription">[static]
      Removes all whitespace characters from the beginning and end
      of the specified string.</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#trimArrayElements()">trimArrayElements</a>(value:String, delimiter:String):String</div>
<div class="summaryTableDescription">[static]
      Removes all whitespace characters from the beginning and end
      of each element in an Array, where the Array is stored as a String.</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="isWhitespace()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isWhitespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function isWhitespace(character:String):Boolean</code><p>
      Returns <code>true</code> if the specified string is
      a single space, tab, carriage return, newline, or formfeed character.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">character</span>:String</code> &mdash; The String that is is being queried. 
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; <code>true</code> if the specified string is
      a single space, tab, carriage return, newline, or formfeed character.
     </td>
</tr>
</table>
</div>
<a name="substitute()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">substitute</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function substitute(str:String, ... rest):String</code><p>
      Substitutes "{n}" tokens within the specified string
      with the respective arguments passed in.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">str</span>:String</code> &mdash; The string to make substitutions in.
      This string can contain special tokens of the form
      <code>{n}</code>, where <code>n</code> is a zero based index,
      that will be replaced with the additional parameters
      found at that index if specified.
           </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code> &mdash; Additional parameters that can be substituted
      in the <code>str</code> parameter at each <code>{n}</code>
      location, where <code>n</code> is an integer (zero based)
      index value into the array of values specified.
      If the first parameter is an array this array will be used as
      a parameter list.
      This allows reuse of this routine in other methods that want to
      use the ... rest signature.
      For example <pre>
         public function myTracer(str:String, ... rest):void
         { 
             label.text += StringUtil.substitute(str, rest) + "\n";
         } </pre>
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; New string with all of the <code>{n}</code> tokens
      replaced with the respective arguments specified.
           </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br>           var str:String = "here is some info '{0}' and {1}";
      trace(StringUtil.substitute(str, 15.4, true));
           // this will output the following string:
      // "here is some info '15.4' and true"
     <p></p>
</div>
<a name="trim()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trim</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function trim(str:String):String</code><p>
      Removes all whitespace characters from the beginning and end
      of the specified string.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">str</span>:String</code> &mdash; The String whose whitespace should be trimmed. 
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Updated String where whitespace was removed from the 
      beginning and end. 
     </td>
</tr>
</table>
</div>
<a name="trimArrayElements()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trimArrayElements</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function trimArrayElements(value:String, delimiter:String):String</code><p>
      Removes all whitespace characters from the beginning and end
      of each element in an Array, where the Array is stored as a String. 
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; The String whose whitespace should be trimmed. 
           </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">delimiter</span>:String</code> &mdash; The String that delimits each Array element in the string.
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Updated String where whitespace was removed from the 
      beginning and end of each element. 
     </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
